import React from 'react'
import './Item.css'
export default function Item(props) {
  console.log(props)
  const { todo, update } = props
  return (
    <li>
      <label>
        <input
          type="checkbox"
          checked={todo.isDone}
          onChange={() => {
            update(todo.id)
          }}
        />
        <span className={todo.isDone ? 'active' : ''}>{todo.todoName}</span>
      </label>
      <button className="btn btn-danger">删除</button>
    </li>
  )
}
